<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		//用户信息管理
		Schema::create('users', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('username')->unique()->nullable();
			$table->string('email')->unique()->nullable();
			$table->string('phone')->unique()->nullable();
			$table->string('password');
			$table->string('reg_ip');
			$table->timestamp('reg_time');
			$table->string('login_ip')->nullable();
			$table->timestamp('login_time')->nullable();
			$table->integer('login_count')->nullable();
			$table->integer('role')->default(0);
			$table ->integer('status')->default(1);
			$table->rememberToken();
			$table->softDeletes();
			$table->timestamps();

		});

	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('users');
	}

}
